﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.DataCollection.OperationCore.OperationEnum;
using ZR.DataCollection.OperationCore.OperationHelper;
using ZR.DataCollection.OperationCore.OperationMode;

namespace ZR.DataCollection.OperationCore.AbstractFactory
{
    public class BaseAbsFactory : IAbsStationFactory
    {
        public virtual event Action<string> Event_Notification;

        protected string _stationType;

        public BaseAbsFactory(string stationType)
        {
            _stationType = stationType;
        }

        public virtual IOperationModel GetOperationInfo(OperationTypeEnum operationType)
        {
            switch (operationType)
            {
                case OperationTypeEnum.Default:
                    return new Defalut((int)operationType, _stationType);

                case OperationTypeEnum.Process:
                    return new Process((int)operationType, _stationType);

                case OperationTypeEnum.Save:
                    return new DataSave((int)operationType, _stationType);

                case OperationTypeEnum.Online:
                    return new Online((int)operationType, _stationType);

                case OperationTypeEnum.Offline:
                    return new Offline((int)operationType, _stationType);

                case OperationTypeEnum.ScanCode:
                    return new ScanCode((int)operationType, _stationType);

                case OperationTypeEnum.Tighten:
                    return new Tighten((int)operationType, _stationType);

                case OperationTypeEnum.Detection:
                    return new Detection((int)operationType, _stationType);

                case OperationTypeEnum.Mark:
                    return new Mark((int)operationType, _stationType);

                default:
                    return null;
            }
        }
    }
}